package com.pocket.insight.base.constant;

import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Sets;

import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * 描述：
 *
 * @author shuize
 * @create 2024/12/14
 */
public class FileConst {

    public static final ImmutableMap<Object, Object> fileType2ExtensionMap = ImmutableMap.builder().put("text/csv", ".csv").put("text/plain", ".txt").put("application/vnd.ms-excel", ".xls").put("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", ".xlsx").put("application/vnd.ms-excel.sheet.macroenabled.12", ".xlsm").put("image/png", ".png").put("image/jpeg", ".jpeg").put("OLE", ".xlsx").build();
    public static final String                       fileTypeExcel         = "file_excel";
    public static final String              fileTypeCSV              = "file_csv";
    public static final String              fileTypeBLF              = "file_blf";
    public static final Set<String>                  FILE_ORIGINS       = Sets.newHashSet(new String[]{"file_excel", "file_csv", "file_blf"});
    public static final ImmutableMap<Object, Object> fileSuffix2TypeMap = ImmutableMap.builder().put(".xls", "file_excel").put(".xlsx", "file_excel").put(".xlsm", "file_excel").put(".csv", "file_csv").put(".txt", "file_csv").put(".dbc", "file_blf").put(".blf", "file_blf").build();
    public static final String                       notSupportedType   = "file_not_supported";
    public static final List<String>        specificFileExtension    = Arrays.asList(".blf", ".dbc");
    public static final List<String>                 needParsedFileType      = Arrays.asList("file_excel", "file_blf");
    public static final ImmutableMap<Object, Object> CSVDelimiterName2StrMap = ImmutableMap.builder().put("colon", ":").put("comma", ",").put("pipe", "|").put("semicolon", ";").put("tab", "\t").build();
    public static final ImmutableMap<Object, Object> CSVDelimiterStr2NameMap = ImmutableMap.builder().put(":", "colon").put(",", "comma").put("|", "pipe").put(";", "semicolon").put("\t", "tab").build();
    public static       long                         FileSizeLowerLimit      = 1000L;
    public static       long                FileLineLowerLimit       = 1000L;
    public static       String              CSVStandardDelimiter     = ",";
    public static       String              CSVStandardQuoteChar     = "\"";
    public static       String              CSVStandardLineSeparator = "\n";
    public static       String              StandardEncoding;
    public static       String              CSVCommnonUsedDelimiter;

}
